home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / programr / rsxwdk2s.zip / RSXWDK / LIBSRC / DOS / DOS41.C < prev    next >
C/C++ Source or Header  |  1994-12-17  |  412b  |  26 lines

  1. #include <errno.h>
  2. #include <sys/doscalls.h>
  3.  
  4.  
  5. /*
  6. ** AH = 0x41
  7. ** DS:DX name (64 bytes)
  8. */
  9. int dos_remove(const char *name)
  10. {
  11.     struct REGPACK r;
  12.     struct SEGPACK sr = { GetDS(), GetES()};
  13.  
  14.     r.eax = 0x4100;
  15.     SET_SEG_OFF(name, sr.ds, r.edx);
  16.  
  17.     _intxr(0x21, &r, &sr);
  18.  
  19.     if (r.eflags & 1) {
  20.     _sys_doserror2errno( r.eax & 0xFFFF);
  21.     return (-1);
  22.     }
  23.     else
  24.     return (0);
  25. }
  26.